const { no, ok } = require('../../utils/utlis');

const holeService = require('../../services/client/holeService');
module.exports = {
	// 树洞
	list: async (req, res, next) => {
		try {
                  let { pageNum, pageSize } = req.body;
			let list = await holeService.list(pageNum, pageSize);
			res.send(ok(list));
		} catch (error) {
			res.send(no(error.message));
		}
	},
	add: async (req, res, next) => {
		try {
			let { content, name, email } = req.body;
			await holeService.add(content, name, email);
			res.send(ok());
		} catch (error) {
			res.send(no(error.message));
		}
	}
};
